package com.nbsaas.boot.entity.agent;

import com.nbsaas.boot.code.annotation.FieldConvert;
import com.nbsaas.boot.code.annotation.FieldName;
import com.nbsaas.boot.code.annotation.FormAnnotation;
import com.nbsaas.boot.code.annotation.SearchItem;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import com.nbsaas.boot.rest.enums.StoreState;
import com.nbsaas.boot.rest.filter.Operator;
import jakarta.persistence.*;
import lombok.Data;


@FormAnnotation(title = "智能体")
@Data
@Entity
@Table(name = "bs_sys_agent")
public class Agent extends AbstractEntity {

    @SearchItem(label = "名称", name = "name")
    @Column(length = 50)
    private String name;

    @SearchItem(label = "分类", name = "catalog", key = "catalog.id", classType = Long.class, operator = Operator.eq)
    @FieldName
    @FieldConvert
    @ManyToOne(fetch = FetchType.LAZY)
    private AgentCatalog catalog;

    private Float temperature;


    @Column(columnDefinition = "json")
    private String configJson;  // 存储JSON格式的配置参数


    @Column(length = 500)
    private String note;

    @Lob
    private String systemPrompt;

    private StoreState storeState;

    private Long version;

}
